﻿using Microsoft.AspNetCore.Mvc.Filters;

namespace B.S.Data.MES.API
{
    /// <summary>
    /// MES全局异常过滤器
    /// </summary>
    public class MESGuoFilters : IExceptionFilter
    {
        private readonly ILogger<MESGuoFilters> logger;

            public MESGuoFilters(ILogger<MESGuoFilters> logger)
        {
            this.logger = logger;
        }

        public void OnException(ExceptionContext context)
        {
            logger.LogError($"【捕获到异常信息内容为】" + context.Exception.Message);
        }
    
    }
}
 